package com.shengzai.mapreduce.filterscore;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;

import java.io.IOException;

public class DriverFilterScore {
    public static void main(String[] args) throws IOException, InterruptedException, ClassNotFoundException {
        Configuration entries = new Configuration();
        Job job = Job.getInstance(entries);
        job.setJobName("FilterScore");
        job.setJarByClass(DriverFilterScore.class);

        job.setMapperClass(MapFilterScore.class);

        job.setMapOutputKeyClass(Text.class);
        job.setMapOutputValueClass(IntWritable.class);

        FileOutputFormat.setOutputPath(job,new Path("hadoop_code/src/data/FilterScore"));
        FileInputFormat.addInputPath(job,new Path("hadoop_code/src/data/StudentJoin/part-r-00000"));

        job.waitForCompletion(true);

    }
}
